import config_4_0
from chat import UML
import utils

if __name__ == '__main__':
    uml = UML(
        api_key=config_4_0.api_key,
        base_url=config_4_0.base_url,
        model=config_4_0.model_name,
        http_client=config_4_0.http_client,
    )
    code = utils.input_multilines('input the function:')
    
    uml_english, uml_chinese = uml.code_to_plantuml(code)
    
    utils.write_to_file(config_4_0.file_output_dir, f'{config_4_0.version}-English.puml', uml_english)
    utils.write_to_file(config_4_0.file_output_dir, f'{config_4_0.version}-Chinese.puml', uml_chinese)
    
    # utils.puml_to_svg('English.puml')
    # utils.puml_to_svg('Chinese.puml')
    
    for conversation in uml.conversation_list:
        print(conversation['role'])
        print(conversation['content'])
        print()
